import request from "../utils/request.js"

export function getChatRoom() {
	return request({
		url: "/chat/getChatRoom",
	})
}

/**
 * 聊天室房间详情
 * @param {Object} data
 */
export function getRoomDetail(data) {
	return request({
		url: "/chat/getRoomDetail",
		data
	})
}
/**
 * 获取聊天记录
 * @param {Object} data
 */
export function getChat(data) {
	return request({
		url: "/chat/getChat",
		data
	})
}

/**
 * 发送消息
 * @param {Object} data
 */
export function sendMsg(data) {
	return request({
		url: "/chat/sendMsg",
		method: "post",
		data
	})
}

/**
 * 更新已读
 * @param {Object} data
 */
export function updateUnread(data) {
	return request({
		url: "/chat/updateUnread",
		method: "post",
		data
	})
}